//
//  YXLableCell.swift
//  Cell动画弹跳
//
//  Created by Rookie_YX on 16/7/19.
//  Copyright © 2016年 YX_Rookie. All rights reserved.
//

import UIKit

class YXLableCell: UITableViewCell {

  var imgV = UIImageView()
  var scriptL = UILabel()
  
  
  init(style: UITableViewCellStyle, reuseIdentifier: String?, frame:CGRect) {
    super.init(style: style, reuseIdentifier: reuseIdentifier)
    
    self.selectionStyle = .None
    contentView.frame = frame
    // UI
    contentView.addSubview(imgView)
    
    imgView.snp_makeConstraints { (make) in
      make.top.equalTo(contentView.snp_top)
      make.left.equalTo(contentView.snp_left)
      make.size.equalTo(CGSizeMake(contentView.frame.width, contentView.frame.height))
    }
 
      contentView.addSubview(scriptLable)
      
      scriptLable.snp_makeConstraints(closure: { (make) in
        make.centerY.equalTo(contentView)
        make.right.equalTo(contentView.snp_right)
        make.size.equalTo(CGSizeMake(100, 50))
      })
 
  }
  
  override func layoutSubviews() {
    print(self.center)
  }
  
  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }
  
  private lazy var imgView: UIImageView = {
    let iv = UIImageView()
    iv.backgroundColor = UIColor.orangeColor()
    self.imgV = iv
    return iv
  }()
  
  private lazy var scriptLable:UILabel = {
    let lab = UILabel()
    lab.textColor = UIColor.brownColor()
    lab.font = UIFont.systemFontOfSize(11)
    lab.backgroundColor = UIColor.cyanColor()
    self.scriptL = lab
    return lab
  }()

}
